<template>
	<div id="">
		<van-tabbar v-model="active">
			<van-tabbar-item icon="wap-home" :dot="a" to="/">首页</van-tabbar-item>
			<van-tabbar-item icon="comment">论坛</van-tabbar-item>
			<van-tabbar-item icon="cart" :dot='b' to="/Shopping">购物车</van-tabbar-item>
			<van-tabbar-item icon="manager" :dot='c' to="/UserMine">我的</van-tabbar-item>
		</van-tabbar>
	</div>
</template>

<script>
	export default {
		props: {
			userName: {
				type: Number,
				required: true
			},
			length: {
				type: Number,
				required: true
			},
			dot: {
				type: Boolean,
				required: true
			}
		},
		data() {
			return {
				active: 0,
				a: true,
				b: false,
				c: false
			};
		},
		created() {
			this.list()
		},
		methods: {
			list() {
				this.active = this.userName
				if (this.userName == 2) {
					this.b = this.dot
					this.a = false
				}
				if (this.length == 3) {
					this.a = false
					this.c = this.dot
					this.active = 3
				}
				console.log(this.userName, 11, this.dot)
				console.log(this.length, this.dot)
			}
		}
	};
</script>

<style>

</style>
